#ifndef __SERVO_H_
#define __SERVO_H_
#include "tim.h"

#define SERVO_NUM 8

#define SERVO_1_Tim htim9
#define SERVO_2_Tim htim9
#define SERVO_3_Tim htim12
#define SERVO_4_Tim htim12
#define SERVO_5_GPIO pwm_GPIO_Port
#define SERVO_6_GPIO pwmE4_GPIO_Port
#define SERVO_7_GPIO pwmB12_GPIO_Port
#define SERVO_8_GPIO pwmB13_GPIO_Port

#define SERVO_1_Channel TIM_CHANNEL_1
#define SERVO_2_Channel TIM_CHANNEL_2
#define SERVO_3_Channel TIM_CHANNEL_1
#define SERVO_4_Channel TIM_CHANNEL_2
#define SERVO_5_Pin pwm_Pin
#define SERVO_6_Pin pwmE4_Pin
#define SERVO_7_Pin pwmB12_Pin
#define SERVO_8_Pin pwmB13_Pin

// 舵机编号,未确定
#define SERVO_BODY 2
#define SERVO_LEFT_ARM 1
#define SERVO_RIGHT_ARM 0
#define SERVO_CAMERA 7
#define SERVO_COLOR 6

//一些角度值
#define SERVO_BODY_INIT 70
#define SERVO_LEFT_ARM_INIT 0
#define SERVO_RIGHT_ARM_INIT 0
#define SERVO_CAMERA_INIT 50
#define SERVO_COLOR_INIT 20

#define SERVO_BODY_FRONT 150
#define SERVO_BODY_BACK 150
#define SERVO_LEFT_ARM_UP 180
#define SERVO_RIGHT_ARM_UP 180
#define SERVO_CAMERA_UP 45
#define SERVO_COLOR_SCAN 90

void ServoInit(void);
void setServoAngleByIndex(uint8_t servoNum, uint16_t angle);
#endif  // !SERVO_H
